package com.coolwen.service;

import com.coolwen.dao.UserInfoMapper;
import com.coolwen.entity.UserInfo;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by user on 2016-11-10.
 */
@Service("userInfo")
public class UserInfoServiceImpl implements UserInfoService {
    @Autowired
    UserInfoMapper userInfoMapper;
    //引入log4j,进行日志打印
    private static final Logger LOGGER = Logger.getLogger(UserInfoServiceImpl.class);

    @Override
    public UserInfo findByUserId(Integer userInfoId) {
        LOGGER.info("weqweqeqe");
        return userInfoMapper.selectByPrimaryKey(userInfoId);
    }

    @Override
    public int addUser(UserInfo userInfo) {

        return userInfoMapper.insertSelective(userInfo);
    }

    @Override
    public List<UserInfo> findALLUser() {
        return userInfoMapper.selectAllUser();
    }
}
